<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/storage/Storage.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/demo/storage/Storage.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'Storage_Id',
            footer: "Foots",
            cnName: '入库信息表',
            name: 'storage/Storage',
            url: "/setpath/api/Storage/",
            sortName: "CreateTime"
        });
        const editFormFields = ref({ "Goods_name": "", "PayStyle": "", "Type": "", "Material": "", "Specification": "", "City_Id": "", "Price": "", "Num": "", "Remarks": "" });
        const editFormOptions = ref([[{ "title": "货物名称", "required": true, "field": "Goods_name", "type": "text" }],
        [{ "dataKey": "入库支付方式", "data": [], "title": "支付方式", "required": true, "field": "PayStyle", "type": "radio" }],
        [{ "dataKey": "入库类型", "data": [], "title": "类型", "required": true, "field": "Type", "type": "select" }],
        [{ "dataKey": "入库材质", "data": [], "title": "材质", "required": true, "field": "Material", "type": "select" }],
        [{ "title": "规格", "required": true, "field": "Specification", "type": "text" }],
        [{ "dataKey": "产地-市", "data": [], "title": "产地", "field": "City_Id", "type": "select" }],
        [{ "title": "单价", "required": true, "field": "Price", "type": "text" }],
        [{ "title": "数量", "required": true, "field": "Num", "type": "number" }],
        [{ "title": "备注", "required": true, "field": "Remarks", "type": "textarea" }]]);
        const searchFormFields = ref({ "Goods_name": "", "PayStyle": "", "Material": "", "City_Id": "", "Recorder": "" });
        const searchFormOptions = ref([[{ "title": "货物名称", "field": "Goods_name", "type": "like" }, { "dataKey": "入库材质", "data": [], "title": "材质", "field": "Material", "type": "select" }, { "dataKey": "产地-市", "data": [], "title": "产地", "field": "City_Id", "type": "like" }], [{ "dataKey": "入库支付方式", "data": [], "title": "支付方式", "field": "PayStyle", "type": "select" }, { "title": "登记人", "field": "Recorder", "type": "like" }]]);
        const columns = ref([{ field: 'Storage_Id', title: '主键id', type: 'string', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'Goods_name', title: '货物名称', type: 'string', width: 110, require: true, align: 'left', sort: true },
        { field: 'PayStyle', title: '支付方式', type: 'string', bind: { key: '入库支付方式', data: [] }, width: 110, require: true, align: 'left' },
        { field: 'Type', title: '类型', type: 'int', bind: { key: '入库类型', data: [] }, width: 110, require: true, align: 'left' },
        { field: 'Material', title: '材质', type: 'int', bind: { key: '入库材质', data: [] }, width: 110, require: true, align: 'left' },
        { field: 'Specification', title: '规格', type: 'string', width: 120, require: true, align: 'left' },
        { field: 'City_Id', title: '产地', type: 'string', bind: { key: '产地-市', data: [] }, width: 110, align: 'left' },
        { field: 'Price', title: '单价', type: 'decimal', width: 110, require: true, align: 'left' },
        { field: 'Num', title: '数量', type: 'int', width: 110, require: true, align: 'left' },
        { field: 'Recorder', title: '登记人', type: 'string', width: 110, align: 'left' },
        { field: 'Remarks', title: '备注', type: 'string', width: 110, require: true, align: 'left' },
        { field: 'CreateTime', title: '创建时间，记录入库记录的创建时间', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'UpdatedTime', title: '记录最后更新时间', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'CreatedName', title: '记录创建者', type: 'string', width: 110, align: 'left' },
        { field: 'UpdatedName', title: '记录最后更新者', type: 'string', width: 110, align: 'left' },
        { field: 'Is_Deleted', title: '逻辑删除标志, 0表示未删除，1表示已删除', type: 'int', width: 110, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
